package com.zy.smartdb.util;

import java.util.Collection;

/**
 * @Description:
 * @Author: zara
 * @Version V3.0
 * @Date: 2022/9/21 3:50 下午
 */

public class CollectionUtil {

    public static boolean isNullOrEmpty(Collection collection) {
        return collection == null || collection.isEmpty();
    }

    public static String join(Collection<String> collection) {
        StringBuilder sb = new StringBuilder();
        for (String s : collection) {
            sb.append(s).append(',');
        }
        int end = sb.length() > 0 ? sb.length()-1 : 0;
        return sb.substring(0, end);
    }
}
